<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>网上商城</title>
    <link href="./css/common.css" rel="stylesheet" type="text/css"/>
    <link href="./css/product.css" rel="stylesheet" type="text/css"/>
</head>
<body>

<div th:replace="header.html"></div>

<div class="container productList">
    <div class="span6">
        <div class="hotProductCategory">
            <dl>
                <dt th:each="cs : ${csList}">
                    <a th:href="${'/goCategory?cid='+cid}+${'&csid='+cs.getCsid()}+${'&amp;currentPage='+pageInfo.pageNum}" th:text="${cs.csname}">蔬菜</a>
                </dt>
            </dl>
        </div>
    </div>
    <div class="span18 last">

        <form id="productForm" action="./image/蔬菜 - Powered By Mango Team.htm" method="get">

            <div id="result" class="result table clearfix">
                <ul>
                    <li th:each="p : ${pageInfo.list}">
                        <a th:href="${'/goDetails?pid='+p.pid}"><!--跳转到详情-->
                            <img th:src="${'http://localhost:8089/'+p.image}" width="170" height="170"  style="display: inline-block;"/>
                            <span style='color:green' th:text="${p.pname}"> 大冬瓜 </span>
                            <span class="price" th:text="${'商城价： ￥'+p.marketPrice+'/份'}"> 商城价： ￥4.78/份 </span>
                        </a>
                    </li>
                </ul>
            </div>
            <!--分页标签-->
            <div class="pagination">
                <th:block th:if="${pageInfo.pageNum==1}">
                    <span class="firstPage"></span>
                    <span class="previousPage">&nbsp;</span>
                </th:block>
                <th:block th:if="${pageInfo.pageNum!=1}">
                    <a class="firstPage" th:href="${'/goCategory?cid='+cid+'&amp;currentPage=1'}+${'&amp;csid='+csid}" th:text="${i}">2</a>
                    <a class="previousPage" th:href="${'/goCategory?cid='+cid+'&amp;currentPage='}+${pageInfo.pageNum-1}+${'&amp;csid='+csid}" th:text="${i}">2</a>
                </th:block>

                <th:block th:each="i : ${#numbers.sequence(1,pageInfo.pages)}">
                    <th:block th:if="${i==pageInfo.pageNum}">
                        <span class="currentPage" th:text="${i}"></span>
                    </th:block>
                    <th:block th:if="${i!=pageInfo.pageNum}">
                        <a th:href="${'/goCategory?cid='+cid+'&amp;currentPage='}+${i}+${'&amp;csid='+csid}" th:text="${i}">2</a>
                    </th:block>
                </th:block>

                <th:block th:if="${pageInfo.pageNum==pageInfo.pages}">
                    <span class="nextPage"></span>
                    <span class="lastPage">&nbsp;</span>
                </th:block>
                <th:block th:if="${pageInfo.pageNum!=pageInfo.pages}">
                    <a class="nextPage" th:href="${'/goCategory?cid='+cid+'&amp;currentPage='}+${pageInfo.pageNum+1}+${'&amp;csid='+csid}" th:text="${i}">2</a>
                    <a class="lastPage" th:href="${'/goCategory?cid='+cid+'&amp;currentPage='}+${pageInfo.pages}+${'&amp;csid='+csid}" th:text="${i}">2</a>
                </th:block>
            </div>
        </form>
    </div>
</div>
<div th:replace="footer.html"></div>
</body></html>